#!/usr/bin/env bash

INSTALL="go get"
case $1 in
  update)
    INSTALL+=" -u"
    ;;
  install)
    ;;
  *)
    echo "$0 [install|update]"
    exit 1
    ;;
esac

TOOL_PATHS="
golang.org/x/lint/golint \
golang.org/x/tools/... \
github.com/alecthomas/gometalinter \
github.com/BurntSushi/toml/cmd/tomlv \
github.com/cweill/gotests/... \
github.com/davidrjenni/reftools/cmd/fillstruct \
github.com/derekparker/delve/cmd/dlv \
github.com/dvyukov/go-fuzz/... \
github.com/fatih/gomodifytags \
github.com/fatih/motion \
github.com/godoctor/godoctor \
github.com/golang/dep/cmd/dep \
github.com/golang/protobuf/protoc-gen-go \
github.com/google/wire/cmd/wire \
github.com/mgechev/revive \
github.com/haya14busa/goplay/cmd/goplay \
github.com/jgautheron/goconst/cmd/goconst \
github.com/jstemmer/gotags \
github.com/josharian/impl \
github.com/kisielk/errcheck \
github.com/klauspost/asmfmt/cmd/asmfmt \
github.com/lukehoban/ident \
github.com/lukehoban/go-find-references \
github.com/newhook/go-symbols \
github.com/mdempsky/gocode \
github.com/ramya-rao-a/go-outline \
github.com/rogpeppe/godef \
github.com/simeji/jid/cmd/jid \
github.com/sourcegraph/go-langserver \
github.com/tylerb/gotype-live \
github.com/uudashr/gopkgs/cmd/gopkgs \
github.com/wgliang/goreporter \
github.com/zmb3/gogetdoc \
honnef.co/go/tools/staticcheck \
sourcegraph.com/sqs/goreturns \
"

for TOOL in $TOOL_PATHS; do
  echo "$INSTALL $TOOL"
  $INSTALL $TOOL
done

echo "install lint tools"
gometalinter --install
